//申请的路由
var express = require('express');
var router = express.Router();

const applyService = require('../service/applyService');

//1.门店管理员
// 修改门店管理员申请状态
router.put('/manager/:id', async function (req, res) {
    let data = applyService.updateManagerState(req.params.id, req.body);
    res.send(data)
})

//查询门店管理员
router.get('/manager', async function (req, res) {
    let { type, value, current, size } = req.query;
    let searchObj = {};
    type ? searchObj[type] = { $regex: value } : "";
    let data = await applyService.findManager(searchObj, { current: current || 1, size: size || 5 })
    res.send(data);
})






//2.门店
// 修改门店申请状态

//查询门店

//注销门店(删除门店)


module.exports = router;
